﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace WindowsFormsApplication1.UCC
{
    class UCCSetupProgram : UCC
    {
        Elevator e; 
        int currentFloor;
        int numFloors;
        string floorNaming; 

        public UCCSetupProgram(Elevator elevator, int floor, int max, string namingConvention)
        {
            e = elevator;
            currentFloor = floor;
            numFloors = max;
            floorNaming = namingConvention; 
        }

        public void Run()
        {
            LiftUIForms.LiftUI liftUI = new LiftUIForms.LiftUI(e);
            liftUI.Show(); 

            //Thread liftUIThread = new Thread(new ThreadStart(liftUI.Show));
           // liftUIThread.IsBackground = true;
            //liftUIThread.Start();  

            //ThreadPool.QueueUserWorkItem(liftUI.run); 
            //MonitoringUI monoUI = new MonitoringUI(e);
            //monoUI.Show();

            if (numFloors == 2)
            {
                new FloorUIForms.FloorUI2(floorNaming, e, liftUI).Show(); 
            }
            else if (numFloors == 3)
            {
                new FloorUIForms.FloorUI3(floorNaming, e).Show(); 
            }
            else if (numFloors == 4)
            {
                new FloorUIForms.FloorUI4(floorNaming, e).Show(); 
            }
            else if (numFloors == 5)
            {
                new FloorUIForms.FloorUI5(floorNaming, e).Show(); 
            }
        }
    }
}
